<!DOCTYPE html PUBLIC>
<html>


<base href="__STATIC__/hou/">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title></title>
	<link href="styles/general.css" rel="stylesheet" type="text/css" />
	<link href="styles/main.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="js/utils.js"></script>
	<script type="text/javascript" src="js/selectzone.js"></script>
	<script type="text/javascript" src="js/colorselector.js"></script>
	<script type="text/javascript" src="js/calendar.php?lang="></script>
</head>
<body>
<h1>
	<span class="action-span"><a href="{:url('Goods/goods_list')}">商品列表</a></span>
	<span class="action-span1"><a href="index.php?act=main">SHOP 管理中心 </a> </span><span id="search_id" class="action-span1"> - 编辑商品信息 </span>
	<div style="clear:both"></div>
</h1>

<div class="tab-div">
    <!-- tab bar -->
    <div id="tabbar-div">
      <p>
        <span class="tab-front" id="general-tab">通用信息</span>
		<span class="tab-back" id="detail-tab">详细描述</span>
		<span class="tab-back" id="mix-tab">其他信息</span>
		<span class="tab-back" id="properties-tab">商品属性</span>
		<span class="tab-back" id="gallery-tab">商品相册</span>
      </p>
    </div>

    <!-- tab body -->
    <div id="tabbody-div">
      <form enctype="multipart/form-data" action="{:url('Goods/adds')}" method="post" name="theForm">
		 <!-- 通用信息 -->
        <table width="90%" id="general-table" align="center" style="display: table;">
			<tbody>
				<tr>
					<td class="label">商品名称：</td>
					<td><input type="text" name="goods_name" size="30"><span class="require-field">*</span></td>
				</tr>
				<tr>
					<td class="label">商品货号： </td>
					<td><input type="text" name="goods_sn" size="20"><span id="goods_sn_notice"></span><br>
					<span class="notice-span" style="display:block" id="noticeGoodsSN">如果您不输入商品货号，系统将自动生成一个唯一的货号。</span></td>
			</tr>
			<tr>
				<td class="label">商品分类：</td>
				<td>
					<select name="cat_id">
						<option value="0">请选择...</option>
						{foreach name="data" item="val"}
							<option value="{$val.cat_id}">
								{for start="0" end="$val.level"}&nbsp;&nbsp;{/for}{$val.cat_name}</option>
						{/foreach}
					</select>
                 </td>
			</tr>
			<tr>
				<td class="label">商品品牌：</td>
				<td>
					<select name="brand_id">
						<option value="0">请选择...</option>
						{foreach name="res" item="val"}
							<option value="{$val.brand_id}">{$val.brand_name}</option>
						{/foreach}
					</select>
				</td>
			</tr>
            <tr>
				<td class="label">本店售价：</td>
				<td><input type="text" name="shop_price" value="" size="20">
				<input type="button" value="按市场价计算">
				<span class="require-field">*</span></td>
			</tr>
          <tr>
            <td class="label">市场售价：</td>
            <td><input type="text" name="market_price" value="" size="20">
              <input type="button" value="取整数">
            </td>
          </tr>

          <tr>
            <td class="label"><label >
				<input type="checkbox" name="is_promote" value="1" checked="checked"> 促销价：</label></td>
            <td id="promote_3"><input type="text" id="promote_1" name="promote_price" value="" size="20"></td>
          </tr>
          <tr id="promote_4">
            <td class="label" id="promote_5">促销日期：</td>
            <td id="promote_6">
              <input name="promote_start_date" type="date" id="promote_start_date" size="12" >-
				- <input name="promote_end_date" type="date" id="promote_end_date" size="12">
            </td>
          </tr>
				<tr>
					<td class="label">上传商品图片：</td>
					<td>
						<input type="file" name="goods_img" size="35">
						<a href="goods.php?act=show_image&amp;img_url=images/200905/goods_img/32_G_1242110760868.jpg" target="_blank">
							<img src="images/yes.gif" border="0"></a>

					</td>
				</tr>
				<tr id="auto_thumb_1">
					<td class="label"> 上传商品缩略图：</td>
					<td id="auto_thumb_3">
						<input type="file" name="goods_thumb" size="35" disabled="">
						<a href="goods.php?act=show_image&amp;img_url=images/200905/thumb_img/32_thumb_G_1242110760196.jpg" target="_blank"><img src="images/yes.gif" border="0"></a>
					</td>
				</tr>
			</tbody></table>

        <!-- 详细描述 -->
        <table width="90%" id="detail-table" style="display: none;">
          <tbody><tr>
            <td>
				<textarea name="goods_desc" id="a" cols="30" rows="10">我是初始值</textarea>
			</td>
          </tr>
        </tbody></table>
		  <script type="text/javascript" charset="utf-8" src="__ROOT__/editor/ueditor.config.js"></script>
		  <script type="text/javascript" charset="utf-8" src="__ROOT__/editor/ueditor.all.min.js"> </script>
		  <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
		  <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
		  <script type="text/javascript">
			  var ue = UE.getEditor('a');
		  </script>
		  <!-- 其他信息 -->
		  <table width="90%" id="mix-table" style="display: none;" align="center">
			  <tbody>
			  <tr>
				  <td class="label">商品重量：</td>
				  <td><input type="text" name="goods_weight" value="" size="20">
			  </tr>
			  <tr>
				  <td class="label"><a href="javascript:showNotice('noticeStorage');" title="点击此处查看提示信息"><img src="images/notice.gif" width="16" height="16" border="0" alt="点击此处查看提示信息"></a> 商品库存数量：</td>
				  <td><input type="text" name="goods_number" value="4" size="20"><br>
					  <span class="notice-span" style="display:block" id="noticeStorage">库存在商品为虚货或商品存在货品时为不可编辑状态，库存数值取决于其虚货数量或货品数量</span></td>
			  </tr>
			  <tr>
				  <td class="label">库存警告数量：</td>
				  <td><input type="text" name="warn_number" value="1" size="20"></td>
			  </tr>
			  <tr>
				  <td class="label">加入推荐：</td>
				  <td><input type="checkbox" name="is_best" value="1" checked="checked">精品 <input type="checkbox" name="is_new" value="1" checked="checked">新品 <input type="checkbox" name="is_hot" value="1" checked="checked">热销</td>
			  </tr>
			  <tr id="alone_sale_1">
				  <td class="label" id="alone_sale_2">上架：</td>
				  <td id="alone_sale_3"><input type="checkbox" name="is_on_sale" value="1" checked="checked"> 打勾表示允许销售，否则不允许销售。</td>
			  </tr>
			  <tr>
				  <td class="label">是否为免运费商品</td>
				  <td><input type="checkbox" name="is_shipping" value="1"> 打勾表示此商品不会产生运费花销，否则按照正常运费计算。</td>
			  </tr>
			  <tr>
				  <td class="label">商品关键词：</td>
				  <td><input type="text" name="keywords" value="2008年10月 GSM,850,900,1800,1900 黑色" size="40"> 用空格分隔</td>
			  </tr>
			  <tr>
				  <td class="label">商品简单描述：</td>
				  <td><textarea name="goods_brief" cols="40" rows="3"></textarea></td>
			  </tr>
			  </tbody></table>
		  <!-- 商品属性 -->
		  <table width="90%" id="properties-table" style="display: none;" align="center">
			  <tbody>
			  <tr>
				  <td class="label">商品类型：</td>
				  <td>
					  <select name="goods_type" class="change">
						  <option >请选择商品类型</option>
						  {foreach name="$goods_type" item="val"}
						  <option value="{$val.goods_type_id}">{$val.goods_type_name}</option>
						  {/foreach}
					  </select><br>
					  <span class="notice-span" style="display:block" id="noticeGoodsType">请选择商品的所属类型，进而完善此商品的属性</span>
				  </td>
			  </tr>
			  <tr>
				  <td id="tbody-goodsAttr" colspan="2" style="padding:0">
					  <table width="100%" id="attrTable">
						  <tbody id="newchange">

						  </tbody>
					  </table>
				  </td>
			  </tr>
			  </tbody>
		  </table>
		  <!-- 商品相册 -->
		  <table width="90%" id="gallery-table" style="display: none;" align="center">
			  <tbody>
			  <tr>
				  <td>
					  <a href="javascript:;" class="plus">[+]</a>
					  图片描述 <input type="text" name="img_desc[]" size="20">
					  上传文件 <input type="file" name="img_url[]">
					  <input type="text" size="40" value="或者输入外部图片链接地址" style="color:#aaa;" onfocus="if (this.value == '或者输入外部图片链接地址'){this.value='http://';this.style.color='#000';}" name="img_file[]">
				  </td>
			  </tr>
			  <script src="__STATIC__/hou/js/jquery-1.11.1.min.js"></script>
			  <script>
				  $(document).on('click','.plus',function(){
					  plus=$(this).parent().parent();
					  plus2=plus.clone();
					  plus2.find('a').replaceWith("<a href='javascript:;' class='subtract'>[-]</a>");
					  $(this).parents('tr').after(plus2);
				  })
				  $(document).on('click','.subtract',function(){
					  $(this).parents('tr').remove();
				  })
			  </script>
        </tbody>
		  </table>

        <div class="button-div">
			<input type="submit" value=" 确定 " id="ad" class="button" >
          <input type="reset" value=" 重置 " class="button">
        </div>
      </form>
    </div>
</div>


<div id="footer">
	版权所有 &copy; 2006-2013 
</div>
<script type="text/javascript" src="js/tab.js"></script>
<script type="text/javascript">
//	function addImg(obj){
//		var src  = obj.parentNode.parentNode;
//		var idx  = rowindex(src);
//		var tbl  = document.getElementById('gallery-table');
//		var row  = tbl.insertRow(idx + 1);
//		var cell = row.insertCell(-1);
//		cell.innerHTML = src.cells[0].innerHTML.replace(/(.*)(addImg)(.*)(\[)(\+)/i, "$1removeImg$3$4-");
//	}
//
//	function removeImg(obj){
//		var row = rowindex(obj.parentNode.parentNode);
//		var tbl = document.getElementById('gallery-table');
//		tbl.deleteRow(row);
//	}
//
//	function dropImg(imgId){
//		Ajax.call('goods.php?is_ajax=1&act=drop_image', "img_id="+imgId, dropImgResponse, "GET", "JSON");
//	}
//
//  	function dropImgResponse(result){
//      if (result.error == 0){
//          document.getElementById('gallery_' + result.content).style.display = 'none';
//      }
//  	}

</script>
</body>
</html>